package com.crazyhat.crazyhat.dto;

import java.time.LocalDateTime;

import org.hibernate.validator.constraints.URL;

import com.crazyhat.crazyhat.anno.SensitiveWordAnno;
import com.crazyhat.crazyhat.attribute.GenderEnum;
import com.fasterxml.jackson.annotation.JsonFormat;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 评论传输对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CommentDTO {
    
    /**
     * 评论ID
     */
    private Integer commentId;

    /**
     * 所属的动态ID
     */
    @NotNull
    private Integer postId;

    /**
     * 评论者ID
     */
    private Integer commentatorId;

    /**
     * 评论时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime commentTime;

    /**
     * 评论内容
     */
    @SensitiveWordAnno
    @NotEmpty
    private String commentContent;

    /**
     * 回复的评论ID
     */
    private Integer replyedCommentId;

    /**
     * 姓名
     */
    @SensitiveWordAnno
    private String name;

    /**
     * 性别
     */
    private GenderEnum gender;

    /**
     * 头像地址
     */
    @URL
    private String avatarUrl;
}
